﻿using Sustainalytics.SharedEntities.EsgResearch;
using Sustainalytics.SharedEntities.EsgResearch.PartialEsgResearch;
using System.Collections.Generic;
using System.Linq;

namespace Sustainalytics.ClientDW.Synchronization.SyncESGData.RPCompanyProfileLogic
{
    //todo:CompanyProfileVersion see if is going to be saved to mongo
    public class RPCompanyProfileMapper
    {
        public RPCompanyProfile Map(EsgResearchProfile entity)
        {
            return new RPCompanyProfile
            {
                Id = entity.Id,
                CapitalIqId = entity.CapitalIqId,
                CompanyName = entity.CompanyName,

                AnalystId = entity.AnalystId,
                AnalystCommentary = entity.AnalystCommentary,

                LastAnnualReportDate = entity.LastAnnualReportDate,
                LastCSRDate = entity.LastCSRDate,
                LastFeedbackRequestDate = entity.LastFeedbackRequestDate,
                LastFeedbackReceivedDate = entity.LastFeedbackReceivedDate,
                SPLCode = entity.SPLCode,

                LastUpdate = entity.LastUpdate,
                LastFullReviewDate = entity.LastFullReviewDate
            };
        }

        public IList<RPCompanyProfile> MapManyToMany(IList<EsgResearchProfile> entities)
        {
            return entities.Select(Map).ToList();
        }
    }
}
